﻿var Tips = function (body, title, id, modal, footer) {
    if (!id) {
        id = 'ModalMessageBox';
    }
    title = title || '提示信息';
    var modelContainer = $('#' + id);
    modelContainer.find(".modal-title").html(title);
    modelContainer.find(".modal-body").html(body);
    if (footer) {
        var footerPart = modelContainer.find(".modal-footer");
        if (!footerPart || footerPart.length == 0) {
            var appendFooter = '<div class="modal-footer"></div>';
            modelContainer.find(".modal-content").append(appendFooter);
            modelContainer.find(".modal-footer").html(footer);
        }
        else {
            footerPart.html(footer);
        }
    }
    else {
        var footerPart = modelContainer.find(".modal-footer");
        if (footerPart && footerPart.length > 0) {
            footerPart.remove();
        }
    }
    modelContainer.modal('show');
    return $('#' + id);
}